import { FormProps, FormSchema } from '/@/components/Table';
import { BasicColumn } from '/@/components/Table/src/types/table';
import { getJulyDictItemListByTypeApi } from '/@/api/admin/julyDictItemApi';
import { getClassificationTreeApi } from "/@/api/website/websiteClassificationApi";
import { uploadApi } from '/@/api/sys/upload';
import {h} from "vue";
import {Tag} from "ant-design-vue";



//表格显示列
export function getBasicColumns(): BasicColumn[] {
  // @ts-ignore
  return [
    {
      title: 'ID',
      dataIndex: 'expertId',
      fixed: 'left',
      width: 100,
    },
    {
      title: '专家名称',
      dataIndex: 'expertName',
      width: 150,

    },
    {
      title: '专家简介',
      dataIndex: 'expertBrief',
      width: 100,
    },
    {
      title: '专家头衔',
      dataIndex: 'expertTitle',
      width: 100,
    },


  ];
}

export function getFormConfig(): Partial<FormProps> {
  return {
    labelWidth: 150,
    baseColProps: { lg: 6, md: 24 },
    schemas: formParamSchema,
  };
}


//编辑表单
export const formParamSchema: FormSchema[] = [
  {
    field: 'expertName',
    label: '专家名称',
    component: 'Input',
  },
  {
    field: 'expertTitle',
    label: '专家头衔',
    component: 'Input',
  },
];

//编辑表单
export const formSchema: FormSchema[] = [
  {
    field: 'expertName',
    label: '专家名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'expertTitle',
    label: '专家头衔',
    component: 'InputTextArea',
    required: true,
  },
  {
    field: 'expertBrief',
    label: '专家简介',
    component: 'InputTextArea',
    required: true,
  },
  {
    field: 'expertPortrait',
    label: '专家头像',
    component: 'Upload',
    required: true,
    componentProps: {
      api: uploadApi,
      accept: ['jpg', 'png', 'jpeg'],
      maxNumber: 1,
      maxSize: 1,
      helpText: '请上传png/jpg 等图片文件，文件大小小于1M,图片比例为4：1,合作伙伴为5：2',
    },
  },
];
